package main

import (
	"flag"
	"fmt"
	"net"
)

func main() {

	//命令行接收参数 nickname
	nickname := ""
	flag.StringVar(&nickname, "nickname", "user", "nickname")
	flag.Parse()

	// 建立与服务端的连接
	conn, err := net.Dial("tcp", "127.0.0.1:20000")
	if err != nil {
		fmt.Println("dial failed, err:", err)
		return
	}
	defer conn.Close()
	// 发送数据
	conn.Write([]byte(nickname + " join room"))

}

//
